package com.cinsea.salary.ext;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.cinsea.common.Env;
import com.cinsea.common.ExtAction;
import com.cinsea.common.JdbcDao;
import com.cinsea.file.model.Filestore;
import com.cinsea.file.service.FilestoreService;
import com.cinsea.hrm.service.HumanService;
import com.cinsea.util.StringUtil;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class SalaryAction extends ExtAction {
    public void execute(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        String action = StringUtil.null2String(request.getParameter("action"));
        JdbcDao jdbcDao = Env.getBean("jdbcDao");
        if (action.equals("fengzhang")) {
            String riqi = StringUtil.null2String(request.getParameter("riqi"));
            String closed = StringUtil.null2String(request.getParameter("closed"));
            if(StringUtil.isEmpty(riqi)||StringUtil.isEmpty(closed)) return;
            String sql = "update ut_salary set closed=? where riqi=?";
            jdbcDao.update(sql, new Object[]{closed,riqi});
            response.getWriter().print("success");
            return;
        }
    }

}
